package c.c.b.a.a;

import c.b.a.a.a;
import java.io.IOException;

/* compiled from: AsyncTimeout */
public class b implements w {
    public final /* synthetic */ w a;
    public final /* synthetic */ c b;

    public b(c cVar, w wVar) {
        this.b = cVar;
        this.a = wVar;
    }

    public x a() {
        return this.b;
    }

    public long b(e eVar, long j) throws IOException {
        this.b.h();
        try {
            long b = this.a.b(eVar, j);
            this.b.i(true);
            return b;
        } catch (IOException e) {
            IOException e2 = e;
            c cVar = this.b;
            if (cVar.l()) {
                e2 = cVar.k(e2);
            }
            throw e2;
        } catch (Throwable th) {
            this.b.i(false);
        }
    }

    public void close() throws IOException {
        this.b.h();
        try {
            this.a.close();
            this.b.i(true);
        } catch (IOException e) {
            IOException e2 = e;
            c cVar = this.b;
            if (cVar.l()) {
                e2 = cVar.k(e2);
            }
            throw e2;
        } catch (Throwable th) {
            this.b.i(false);
        }
    }

    public String toString() {
        StringBuilder g = a.g("AsyncTimeout.source(");
        g.append(this.a);
        g.append(")");
        return g.toString();
    }
}
